package com.mrjy.queries.dao;

import java.util.List;

import com.mrjy.common.dto.MyMessagesDto;
import com.mrjy.common.dto.QuestionCommentDto;
import com.mrjy.common.entity.MessageInfo;
import com.mrjy.common.entity.QuestionComment;
import com.mrjy.common.entity.QuestionInfo;
import com.mrjy.common.entity.QuestionNoticeInfo;
import com.mrjy.queries.dto.NewCommentWithTypesDTO;
import com.mrjy.queries.dto.PayQuestionCommentDTO;
import com.mrjy.queries.dto.PayQuestionCommentParamDTO;

public interface IQuestionCommentDao {
	
	/**
	 * 分页查询评论--根据问题id
	 * @param questionComment
	 * @return
	 */
	List<QuestionComment> queryCommentsByPage(QuestionComment questionComment);
	/**
	 * 评论
	 * @param questionComment
	 * @return
	 */
	int insert(QuestionComment questionComment);
	
	QuestionComment queryById(QuestionComment questionComment);
	
	/**
	 * 将未读评论标志为已读
	 * @param userId/ids
	 * @return
	 */
	int readComment(QuestionComment comment);
	
	/**
	 * 统计评论未读数量
	 * @param userId
	 * @return
	 */
	int countNoReadComment(int userId);
	
	/**
	 * 获取点赞评论历史已读通知
	 * @param comment
	 * @return
	 */
	List<QuestionNoticeInfo> queryNotice(QuestionNoticeInfo questionNoticeInfo);

	/**
	 * 获取未读通知
	 * @param noticeInfo
	 * @return
	 */
	List<QuestionNoticeInfo> queryNoReadNotice(QuestionNoticeInfo noticeInfo);
	List<QuestionComment> queryPageCommentsOrderByNum(QuestionComment comment);


	/**
	 * 通过questionId查询一级评论
	 * @param info
	 * @return
	 */
	public List<QuestionComment> selectCommentByQuestionId(QuestionComment info);
	/**
	 * 通过questionId查询一级总评论数
	 * @param questionId
	 * @return
	 */
	public int queryTotalFirstCommentCountByQuestionId(Integer questionId);
	/**
	 * 通过quoteCommentId查询二级评论
	 * @param info
	 * @return
	 */
	public 	List<QuestionComment> selectSecondCommentByQuoteCommentId(QuestionComment info);
	/**
	 * 一级评论数加1
	 * @param quoteCommentId
	 * @return
	 */
    public int addCommentNum(Integer id);

    /**
	 * 点赞数加1
	 * @param id
	 * @return
	 */
	public int addGoodNum(Integer id);

    public List<QuestionCommentDto> queryMyQAPageByUserId(QuestionComment comment);

    /**
     * 统计用户回答的数目
     * @param userId
     * @return
     */
    int countMyQAPageByUserId(int userId);

	List<MyMessagesDto> queryMyMessagesCommentPageByCommentedId(MyMessagesDto dto);
	
	int queryTotalUnReadNumByCommentedId(MessageInfo info);
	
	List<MyMessagesDto> queryMyMessagesGoodPageByCommentedId(MyMessagesDto dto);


    public int updateReadFlagToReaded(Integer id);

    int countCommentsOrderByNum(QuestionComment comment);
	
	QuestionComment queryCommentByQid(QuestionComment comment);
	
	int updateById(QuestionComment comment);
	
	int updateDisableFlag(QuestionComment comment);
	
	List<QuestionComment> selectQuestionCommentListPage(QuestionComment info);
	
	int countQuestionComment(QuestionComment info);
	List<MyMessagesDto> queryMyMessagesGoodNumPageByCommentedId(
			MyMessagesDto dto);
	int queryTotalUnreadGoodNumByCommentedId(MessageInfo info);

    List<QuestionCommentDto> quesyNewTextComment(QuestionInfo info);

    List<QuestionComment> queryPageCommentsHot(QuestionComment comment);

    List<QuestionCommentDto> queryPageCommentWithRecord(QuestionComment comment);

    int querySumGoodNumByUserId(QuestionComment info);

    List<MyMessagesDto> queryMyMessagesInvitedPageByCommentedId(MyMessagesDto dto);
	int queryTotalUnreadRecordNumByCommentedId(Integer userId);

    QuestionComment queryTeacherCommentInfoByQidUid(QuestionComment info);

    QuestionComment queryDeserveToListen(QuestionComment info);

    List<QuestionCommentDto> quesyNewRecordComment(QuestionInfo info);

    QuestionComment queryCommentInfoByQid(QuestionComment comment);

    List<QuestionComment> queryPageTopicCommentsHot(QuestionComment comment);
	List<QuestionComment> queryListForImportSolr(QuestionComment info);
	List<QuestionComment> queryConsultantMine(QuestionComment comment);
	int queryFirstCommentNumByQuestionId(Integer questionId);
	
	NewCommentWithTypesDTO  queryQuesctionContentByTypeIds(String[] typeIds);
	
	List<PayQuestionCommentDTO> queryPayQuestionComment(PayQuestionCommentParamDTO param);
	int queryCountPayQuestionComment(PayQuestionCommentParamDTO param);
}
